home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Conversion / Convert_RTF / Source / rtfConverter.h < prev    next >
Text File  |  1993-10-02  |  3KB  |  110 lines

  1. /***********************************************************************\
  2. Converter class for Convert RTF which converts between Mac and NeXT rtf formats.
  3. Copyright (C) 1993 David John Burrowes
  4.  
  5. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version.
  6.  
  7. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  8.  
  9. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  10.  
  11. The author, David John Burrowes, can be reached at:
  12.     davidjohn@kira.net.netcom.com
  13.     David John Burrowes
  14.     1926 Ivy #10
  15.     San Mateo, CA 94403-1367
  16. \***********************************************************************/
  17.  
  18.  
  19. #import "AbstractConverter.h"
  20. #import "FontEntry.h"
  21. //
  22. //    Types of possible source file kinds
  23. //
  24. typedef enum {
  25.     MacRTF,
  26.     NeXTRTF
  27. } sources;
  28. //
  29. //    Which mode we are in the midst of in terms of writing things out
  30. //
  31. typedef enum {
  32.     normal,
  33.     inColorTable,
  34.     inFontTable
  35. } WritingState;
  36.  
  37. //
  38. //    93.02.15    djb    added enumerated type for enhancement of types of font conversion.
  39. //
  40. typedef enum
  41. {
  42.     ConvertAll,
  43.     ConvertStandard,
  44.     ConvertNone
  45. }
  46. GuiConvertChoices;
  47.  
  48.  
  49. @interface rtfConverter:AbstractConverter
  50. {
  51.     Boolean    colorsUsed;
  52.     Boolean    addedSymbol;
  53.     Instance    fontTable;
  54.     sources    ConvertSource;
  55.     Integer    SymbolNumber;
  56.     Integer    numPicts;
  57.     Integer    pictNum;
  58.     Instance    MacTextConverter;
  59.     Instance    NeXTTextConverter;
  60.     Instance    CharConverter;
  61.     
  62.     Boolean    RemoveUnderline;
  63.     Boolean    AlterSingleQuotes;
  64.     GuiConvertChoices    ConvertAllText;
  65.     Boolean    ExtractPicts;
  66.     Boolean    ConvertPictures;
  67.     Boolean    KeepTokensForMe;
  68.  
  69.     Boolean    PictConverterIsOpen;
  70.     port_t    PictPort;
  71.     
  72.     //
  73.     //    93.04.03    Added for bug-fix
  74.     //
  75.     ConvertTypes*    CharConvertStack;
  76.     Integer            StackLocation;
  77.     Integer            StackTop;
  78. }
  79.  
  80. - init;
  81. - free;
  82. - (Boolean) isThisAGoodFile: Instance;
  83.  
  84. - SetConversionDirection: (Boolean) convertAsMacRTF;
  85. - RemoveFirstNeXTUnderline: (Boolean) StripFirstUL0;
  86. - ConvertTheSingleQuotes: (Boolean) doAsMac;
  87. - SetTextConversion: (GuiConvertChoices) convertText;
  88. - SetPictConversion: (Boolean) ConvertPictData AndDataRemoval:  (Boolean) DeletePictData;
  89.  
  90. - examineFile: sourceFile;
  91. - ConvertFrom: sourceFile To: destinationFile;
  92.  
  93. - PrepareFontTable;
  94. - WriteFontTableEntriesTo: destinationFile;
  95. - ConvertWordIn: thetoken  To: destinationFile WithConversion: (ConvertTypes) ConvertChars;
  96. - ConvertThisChar: (Character) aCharacter Into: destinationFile;
  97. - ConvertMacPictImageIn: sourceFile  To: destinationfile;
  98. - (ByteString) Convert: (Integer) sourceSize BytesToBinFrom: (ByteString) source;
  99. //
  100. //    93.04.03    djb    Added for char conversion bug fix
  101. //
  102. - ResetStack;
  103. - StartNewGroup;
  104. - FinishGroup;
  105. - SetCurrentConverstionTo: (ConvertTypes) newValue;
  106. - (ConvertTypes) GetCurrentConversion;
  107.  
  108. @end
  109.  
  110.